/**
 */
package gradingsystem.impl;

import gradingsystem.GradingsystemPackage;
import gradingsystem.MinRequirement;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Min Requirement</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gradingsystem.impl.MinRequirementImpl#getAmount <em>Amount</em>}</li>
 *   <li>{@link gradingsystem.impl.MinRequirementImpl#getIsRelativAmount <em>Is Relativ Amount</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MinRequirementImpl extends EObjectImpl implements MinRequirement {
	/**
	 * The default value of the '{@link #getAmount() <em>Amount</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAmount()
	 * @generated
	 * @ordered
	 */
	protected static final Float AMOUNT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getAmount() <em>Amount</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAmount()
	 * @generated
	 * @ordered
	 */
	protected Float amount = AMOUNT_EDEFAULT;

	/**
	 * The default value of the '{@link #getIsRelativAmount() <em>Is Relativ Amount</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIsRelativAmount()
	 * @generated
	 * @ordered
	 */
	protected static final Boolean IS_RELATIV_AMOUNT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getIsRelativAmount() <em>Is Relativ Amount</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIsRelativAmount()
	 * @generated
	 * @ordered
	 */
	protected Boolean isRelativAmount = IS_RELATIV_AMOUNT_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MinRequirementImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GradingsystemPackage.Literals.MIN_REQUIREMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Float getAmount() {
		return amount;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAmount(Float newAmount) {
		Float oldAmount = amount;
		amount = newAmount;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GradingsystemPackage.MIN_REQUIREMENT__AMOUNT, oldAmount, amount));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Boolean getIsRelativAmount() {
		return isRelativAmount;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setIsRelativAmount(Boolean newIsRelativAmount) {
		Boolean oldIsRelativAmount = isRelativAmount;
		isRelativAmount = newIsRelativAmount;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GradingsystemPackage.MIN_REQUIREMENT__IS_RELATIV_AMOUNT, oldIsRelativAmount, isRelativAmount));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GradingsystemPackage.MIN_REQUIREMENT__AMOUNT:
				return getAmount();
			case GradingsystemPackage.MIN_REQUIREMENT__IS_RELATIV_AMOUNT:
				return getIsRelativAmount();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GradingsystemPackage.MIN_REQUIREMENT__AMOUNT:
				setAmount((Float)newValue);
				return;
			case GradingsystemPackage.MIN_REQUIREMENT__IS_RELATIV_AMOUNT:
				setIsRelativAmount((Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GradingsystemPackage.MIN_REQUIREMENT__AMOUNT:
				setAmount(AMOUNT_EDEFAULT);
				return;
			case GradingsystemPackage.MIN_REQUIREMENT__IS_RELATIV_AMOUNT:
				setIsRelativAmount(IS_RELATIV_AMOUNT_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GradingsystemPackage.MIN_REQUIREMENT__AMOUNT:
				return AMOUNT_EDEFAULT == null ? amount != null : !AMOUNT_EDEFAULT.equals(amount);
			case GradingsystemPackage.MIN_REQUIREMENT__IS_RELATIV_AMOUNT:
				return IS_RELATIV_AMOUNT_EDEFAULT == null ? isRelativAmount != null : !IS_RELATIV_AMOUNT_EDEFAULT.equals(isRelativAmount);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (amount: ");
		result.append(amount);
		result.append(", isRelativAmount: ");
		result.append(isRelativAmount);
		result.append(')');
		return result.toString();
	}

} //MinRequirementImpl
